<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/07-then方法返回值-again.js"></script>
</head>
<body>
    <script>
        let p = new Promise((resolve, reject)=>{
            // resolve('ok');
            reject('error');
        })
        let res = p.then(value=>{
            // res 一定是一个Promise对象

            //    return 
            // 1. 非promise ==> resolve
            // 2. promise对象 ==> 


            // 3. throw 123  ==> reject

            // return 123;
            return new Promise((resolve,reject)=>{
                resolve('ok');
            })
        },reason=>{
            return new Promise((resolve,reject)=>{
                setTimeout(()=>{
                    resolve('ok123');
                },1000)
            })
        })
        console.log('res: ', res);
    </script>
</body>
</html>